<template>
    <div class="fullscreen-container" ref="homeref">
        <!-- 公共顶部 -->
        <large-screen-header :to="'/index'" :back="true" />
        <!-- 主体部分 -->
        <div class="app-main">
            <!-- 左侧 -->
            <div class="app-left">
            </div>
            <!-- 中心部分 -->
            <div class="app-center">
            </div>
            <!-- 右侧 -->
            <div class="app-right">
            </div>
        </div>
    </div>
</template>

<script setup>
const router = useRouter() // 路由
const route = useRoute() // 路由

const toggleFullscreen = () => {
    if (!document.fullscreenElement) {
        document.documentElement.requestFullscreen().catch(err => {
            console.error(`无法进入全屏模式: ${err.message}`);
        });
    }
}
watch(
    () => route.query.beforePath,
    (val) => {
        if (val && val == '/index')
            toggleFullscreen()
    }, { immediate: true }
)
</script>

<style lang="scss">
.fullscreen-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: rgb(0, 24, 45);
    margin: 0;
    padding: 0;
}

.app-main {
    display: flex;
    justify-content: space-between;
    background-color: pink;
    flex: 1;

    :deep(.app-left) {
        margin-left: 30px;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: calc(100% - 40px);
        width: 450px;
        position: relative;

        .app-left-item {
            flex: auto;
        }
    }

    .app-map {
        width: 960px;
        height: 100%;
        //overflow: hidden; //test
        position: relative;
    }

    :deep(.app-right) {
        margin-right: 30px;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: calc(100% - 40px);
        width: 450px;

        .app-right-item {
            flex: auto;
        }
    }
}
</style>